﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Data.Tables
{
    [Table("User")]
    public class User : UserFields
    { }

    public class UserQuery : UserFields
    {
        [Display(Name = "Role")]
        public string RoleName { get; set; }

        [Display(Name = "Work Location")]
        public string WorkLocationName { get; set; }

        [Display(Name = "Is Active")]
        public string IsActiveYesNo { get; set; }
    }

    public class UserFields
    {
        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        [Display(Name = "ID")]
        public int ID { get; set; }

        [Required]
        [Display(Name = "User Name")]
        [StringLength(56)]
        public string UserName { get; set; }

        [Required]
        [Display(Name = "Role")]
        public int RoleID { get; set; }

        [Required]
        [Display(Name = "Work Location")]
        public int WorkLocationID { get; set; }

        [Display(Name = "Is Active")]
        public bool IsActive { get; set; }
    }

}